import pypinyin

if __name__ == "__main__":

    text_list = ['着落', '疑似地上霜', '举头望明月', '低头思故乡绿']
    pinyin = pypinyin.slug(text_list)
    for i in range(len(text_list)):
        pinyin = pypinyin.slug(text_list[i], separator="_")  # 拼音不带声调 ,separator 为设置拼音连接符号
        pinyin2 = pypinyin.pinyin(text_list[i], heteronym=True)  # 拼音带声调
        print("[{}] {} : {}".format(i + 1, text_list[i], pinyin2))
